package com.android.dci.project;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import org.ksoap2.transport.Transport;

import android.app.Activity;
import android.os.Bundle;

public class WebServices extends Activity
{
	
	private static final String SOAP_ACTION = "getRating";
    private static final String METHOD_NAME = "getRating";
    private static final String NAMESPACE = "http://tempuri.org";
    private static final String url = "http://www.galatta.com/iphone/isizzle/isizzle.php";
    
	 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
     
        //CALL the web service method 
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        
        envelope.setOutputSoapObject(request);
        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(url);               
        androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        
        try
        {
         androidHttpTransport.call(SOAP_ACTION, envelope);
         Object resultsRequestSOAP = (Object) envelope.getResponse();
         
        }catch (Exception e) {
			e.printStackTrace();
		}
    }
        
}
